<template>
  <div class="hello">
      <el-dialog title="名称" :visible.sync="dialogFormVisible">
  <el-form :model="form">
    <el-form-item label="名称" :label-width="formLabelWidth">
      <el-input v-model="form.title" autocomplete="off"></el-input>
    </el-form-item>
     <el-form-item label="简介" :label-width="formLabelWidth">
      <el-input v-model="form.context" autocomplete="off"></el-input>
    </el-form-item>
     <el-form-item label="作者" :label-width="formLabelWidth">
      <el-input v-model="form.anthor" autocomplete="off"></el-input>
    </el-form-item>
  </el-form>
  <div slot="footer" class="dialog-footer">
    <el-button @click="dialogFormVisible = false">取 消</el-button>
    <el-button type="primary" @click="dialogFormVisible = false,yes()" >确 定</el-button>
  </div>
</el-dialog>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        dialogTableVisible: false,
        dialogFormVisible: false,
        form: {
          title: '',
          context: '',
          anthor: ''
        },
        formLabelWidth: '120px'
      };
    },
    methods:{
      yes(){
        console.log(this.form);
        this.$api.pushlist().then(res=>{
          this.form= {
          title: this.form.title,
          context: this.form.title,
          anthor: this.form.anthor
        },
          this.$api.getlist()
          console.log(res);
        })
      }
    }
  };
</script>

<style>

</style>